{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d269bbe0",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "d5d7c04b",
   "metadata": {},
   "outputs": [],
   "source": [
    "s1 = pd.Series([1,2,3,4])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "32d4e159",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0    1\n",
      "1    2\n",
      "2    3\n",
      "3    4\n",
      "dtype: int64 <class 'pandas.core.series.Series'>\n"
     ]
    }
   ],
   "source": [
    "print(s1,type(s1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e594f8f9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1.max()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "676b3317",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.2909944487358056"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1.std()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "74461b8e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.5"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(s1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "5ddfbeea",
   "metadata": {},
   "outputs": [],
   "source": [
    "s2 = pd.Series([1,2,3,4],index=['a','b','c','d'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "b46c5154",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a    1\n",
      "b    2\n",
      "c    3\n",
      "d    4\n",
      "dtype: int64 <class 'pandas.core.series.Series'>\n"
     ]
    }
   ],
   "source": [
    "print(s2,type(s2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "85804bfd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s2['c']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "bbacddca",
   "metadata": {},
   "outputs": [],
   "source": [
    "dict1 = {\n",
    "    'a':11,\n",
    "    'b':12,\n",
    "    'c':13\n",
    "}\n",
    "s3 = pd.Series(dict1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "fff4e708",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a    11\n",
      "b    12\n",
      "c    13\n",
      "dtype: int64 <class 'pandas.core.series.Series'>\n"
     ]
    }
   ],
   "source": [
    "print(s3,type(s3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "17903ac6",
   "metadata": {},
   "outputs": [],
   "source": [
    "dict2 = {\n",
    "    'name':['zhangSan','lisi','wangwu'],\n",
    "    'age':[18,20,19]\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "75d30e71",
   "metadata": {},
   "outputs": [],
   "source": [
    "df1 = pd.DataFrame(dict2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "a3ebf767",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "       name  age\n",
      "0  zhangSan   18\n",
      "1      lisi   20\n",
      "2    wangwu   19 <class 'pandas.core.frame.DataFrame'>\n"
     ]
    }
   ],
   "source": [
    "print(df1,type(df1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "eb022340",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>zhangSan</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>lisi</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       name  age\n",
       "0  zhangSan   18\n",
       "1      lisi   20"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.loc[0:1:1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "73488231",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>zhangSan</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>lisi</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>wangwu</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       name  age\n",
       "0  zhangSan   18\n",
       "1      lisi   20\n",
       "2    wangwu   19"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "0d524c83",
   "metadata": {},
   "outputs": [],
   "source": [
    "i = df1['name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "d8d97ad5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.series.Series'>\n"
     ]
    }
   ],
   "source": [
    "print(type(i))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "5c77ff08",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    zhangSan\n",
       "1        lisi\n",
       "2      wangwu\n",
       "Name: name, dtype: object"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "4177cbbe",
   "metadata": {},
   "outputs": [],
   "source": [
    "i2 = df1[['name','age']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "b52ca85a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.frame.DataFrame"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(i2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "7a812b53",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>zhangSan</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>lisi</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>wangwu</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       name  age\n",
       "0  zhangSan   18\n",
       "1      lisi   20\n",
       "2    wangwu   19"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i2.head(100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "3053d887",
   "metadata": {},
   "outputs": [],
   "source": [
    "i3 = df1['age']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "b3913cd8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.series.Series"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(i3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "23d919b3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    18\n",
       "1    20\n",
       "2    19\n",
       "Name: age, dtype: int64"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "e63c2981",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'name': 0    zhangSan\n",
       " 1        lisi\n",
       " 2      wangwu\n",
       " Name: name, dtype: object,\n",
       " 'age': 0    18\n",
       " 1    20\n",
       " 2    19\n",
       " Name: age, dtype: int64}"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dict3={\n",
    "    'name':i,\n",
    "    'age':i3\n",
    "}\n",
    "\n",
    "dict3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "654934c1",
   "metadata": {},
   "outputs": [],
   "source": [
    "df2 = pd.DataFrame(dict3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "8a7d5855",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>zhangSan</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>lisi</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>wangwu</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       name  age\n",
       "0  zhangSan   18\n",
       "1      lisi   20\n",
       "2    wangwu   19"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "e56ab111",
   "metadata": {},
   "outputs": [],
   "source": [
    "stuDF = pd.read_csv(\"../data/students.txt\",header=None,names=['id','name','age','gender','clazz'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "67d90a4c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.frame.DataFrame"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(stuDF)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "867b8624",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>clazz</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>施笑槐</td>\n",
       "      <td>22</td>\n",
       "      <td>女</td>\n",
       "      <td>文科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100002</td>\n",
       "      <td>吕金鹏</td>\n",
       "      <td>24</td>\n",
       "      <td>男</td>\n",
       "      <td>文科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100003</td>\n",
       "      <td>单乐蕊</td>\n",
       "      <td>22</td>\n",
       "      <td>女</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100004</td>\n",
       "      <td>葛德曜</td>\n",
       "      <td>24</td>\n",
       "      <td>男</td>\n",
       "      <td>理科三班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100005</td>\n",
       "      <td>宣谷芹</td>\n",
       "      <td>22</td>\n",
       "      <td>女</td>\n",
       "      <td>理科五班</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           id name  age gender clazz\n",
       "0  1500100001  施笑槐   22      女  文科六班\n",
       "1  1500100002  吕金鹏   24      男  文科六班\n",
       "2  1500100003  单乐蕊   22      女  理科六班\n",
       "3  1500100004  葛德曜   24      男  理科三班\n",
       "4  1500100005  宣谷芹   22      女  理科五班"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stuDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "7cf228ae",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      1500100001\n",
       "1      1500100002\n",
       "2      1500100003\n",
       "3      1500100004\n",
       "4      1500100005\n",
       "          ...    \n",
       "995    1500100996\n",
       "996    1500100997\n",
       "997    1500100998\n",
       "998    1500100999\n",
       "999    1500101000\n",
       "Name: id, Length: 1000, dtype: int64"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stuDF['id']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "f4418203",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>施笑槐</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100002</td>\n",
       "      <td>吕金鹏</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100003</td>\n",
       "      <td>单乐蕊</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100004</td>\n",
       "      <td>葛德曜</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100005</td>\n",
       "      <td>宣谷芹</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>995</th>\n",
       "      <td>1500100996</td>\n",
       "      <td>厉运凡</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>996</th>\n",
       "      <td>1500100997</td>\n",
       "      <td>陶敬曦</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>997</th>\n",
       "      <td>1500100998</td>\n",
       "      <td>容昆宇</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>998</th>\n",
       "      <td>1500100999</td>\n",
       "      <td>钟绮晴</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>999</th>\n",
       "      <td>1500101000</td>\n",
       "      <td>符瑞渊</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1000 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             id name  age\n",
       "0    1500100001  施笑槐   22\n",
       "1    1500100002  吕金鹏   24\n",
       "2    1500100003  单乐蕊   22\n",
       "3    1500100004  葛德曜   24\n",
       "4    1500100005  宣谷芹   22\n",
       "..          ...  ...  ...\n",
       "995  1500100996  厉运凡   24\n",
       "996  1500100997  陶敬曦   21\n",
       "997  1500100998  容昆宇   22\n",
       "998  1500100999  钟绮晴   23\n",
       "999  1500101000  符瑞渊   23\n",
       "\n",
       "[1000 rows x 3 columns]"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stuDF[['id','name','age']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "958f3c13",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>clazz</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>施笑槐</td>\n",
       "      <td>22</td>\n",
       "      <td>女</td>\n",
       "      <td>文科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100002</td>\n",
       "      <td>吕金鹏</td>\n",
       "      <td>24</td>\n",
       "      <td>男</td>\n",
       "      <td>文科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100003</td>\n",
       "      <td>单乐蕊</td>\n",
       "      <td>22</td>\n",
       "      <td>女</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100004</td>\n",
       "      <td>葛德曜</td>\n",
       "      <td>24</td>\n",
       "      <td>男</td>\n",
       "      <td>理科三班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100005</td>\n",
       "      <td>宣谷芹</td>\n",
       "      <td>22</td>\n",
       "      <td>女</td>\n",
       "      <td>理科五班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1500100006</td>\n",
       "      <td>边昂雄</td>\n",
       "      <td>21</td>\n",
       "      <td>男</td>\n",
       "      <td>理科二班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>1500100007</td>\n",
       "      <td>尚孤风</td>\n",
       "      <td>23</td>\n",
       "      <td>女</td>\n",
       "      <td>文科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1500100008</td>\n",
       "      <td>符半双</td>\n",
       "      <td>22</td>\n",
       "      <td>女</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           id name  age gender clazz\n",
       "0  1500100001  施笑槐   22      女  文科六班\n",
       "1  1500100002  吕金鹏   24      男  文科六班\n",
       "2  1500100003  单乐蕊   22      女  理科六班\n",
       "3  1500100004  葛德曜   24      男  理科三班\n",
       "4  1500100005  宣谷芹   22      女  理科五班\n",
       "5  1500100006  边昂雄   21      男  理科二班\n",
       "6  1500100007  尚孤风   23      女  文科六班\n",
       "7  1500100008  符半双   22      女  理科六班"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stuDF.head(8)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "29c7ce26",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>clazz</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>990</th>\n",
       "      <td>1500100991</td>\n",
       "      <td>冉飞昂</td>\n",
       "      <td>22</td>\n",
       "      <td>男</td>\n",
       "      <td>理科一班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>991</th>\n",
       "      <td>1500100992</td>\n",
       "      <td>莫运盛</td>\n",
       "      <td>24</td>\n",
       "      <td>男</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>992</th>\n",
       "      <td>1500100993</td>\n",
       "      <td>衡从蕾</td>\n",
       "      <td>21</td>\n",
       "      <td>女</td>\n",
       "      <td>理科二班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>993</th>\n",
       "      <td>1500100994</td>\n",
       "      <td>相凌青</td>\n",
       "      <td>24</td>\n",
       "      <td>女</td>\n",
       "      <td>理科四班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>994</th>\n",
       "      <td>1500100995</td>\n",
       "      <td>寿芷卉</td>\n",
       "      <td>24</td>\n",
       "      <td>女</td>\n",
       "      <td>理科五班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>995</th>\n",
       "      <td>1500100996</td>\n",
       "      <td>厉运凡</td>\n",
       "      <td>24</td>\n",
       "      <td>男</td>\n",
       "      <td>文科三班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>996</th>\n",
       "      <td>1500100997</td>\n",
       "      <td>陶敬曦</td>\n",
       "      <td>21</td>\n",
       "      <td>男</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>997</th>\n",
       "      <td>1500100998</td>\n",
       "      <td>容昆宇</td>\n",
       "      <td>22</td>\n",
       "      <td>男</td>\n",
       "      <td>理科四班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>998</th>\n",
       "      <td>1500100999</td>\n",
       "      <td>钟绮晴</td>\n",
       "      <td>23</td>\n",
       "      <td>女</td>\n",
       "      <td>文科五班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>999</th>\n",
       "      <td>1500101000</td>\n",
       "      <td>符瑞渊</td>\n",
       "      <td>23</td>\n",
       "      <td>男</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             id name  age gender clazz\n",
       "990  1500100991  冉飞昂   22      男  理科一班\n",
       "991  1500100992  莫运盛   24      男  理科六班\n",
       "992  1500100993  衡从蕾   21      女  理科二班\n",
       "993  1500100994  相凌青   24      女  理科四班\n",
       "994  1500100995  寿芷卉   24      女  理科五班\n",
       "995  1500100996  厉运凡   24      男  文科三班\n",
       "996  1500100997  陶敬曦   21      男  理科六班\n",
       "997  1500100998  容昆宇   22      男  理科四班\n",
       "998  1500100999  钟绮晴   23      女  文科五班\n",
       "999  1500101000  符瑞渊   23      男  理科六班"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stuDF.tail(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "7642104e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 1000 entries, 0 to 999\n",
      "Data columns (total 5 columns):\n",
      " #   Column  Non-Null Count  Dtype \n",
      "---  ------  --------------  ----- \n",
      " 0   id      1000 non-null   int64 \n",
      " 1   name    1000 non-null   object\n",
      " 2   age     1000 non-null   int64 \n",
      " 3   gender  1000 non-null   object\n",
      " 4   clazz   1000 non-null   object\n",
      "dtypes: int64(2), object(3)\n",
      "memory usage: 39.2+ KB\n"
     ]
    }
   ],
   "source": [
    "stuDF.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "806de131",
   "metadata": {},
   "outputs": [],
   "source": [
    "stuDF['age'] = stuDF['age'].astype('float')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "c8c4ac41",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>clazz</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>施笑槐</td>\n",
       "      <td>22.0</td>\n",
       "      <td>女</td>\n",
       "      <td>文科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100002</td>\n",
       "      <td>吕金鹏</td>\n",
       "      <td>24.0</td>\n",
       "      <td>男</td>\n",
       "      <td>文科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100003</td>\n",
       "      <td>单乐蕊</td>\n",
       "      <td>22.0</td>\n",
       "      <td>女</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100004</td>\n",
       "      <td>葛德曜</td>\n",
       "      <td>24.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科三班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100005</td>\n",
       "      <td>宣谷芹</td>\n",
       "      <td>22.0</td>\n",
       "      <td>女</td>\n",
       "      <td>理科五班</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           id name   age gender clazz\n",
       "0  1500100001  施笑槐  22.0      女  文科六班\n",
       "1  1500100002  吕金鹏  24.0      男  文科六班\n",
       "2  1500100003  单乐蕊  22.0      女  理科六班\n",
       "3  1500100004  葛德曜  24.0      男  理科三班\n",
       "4  1500100005  宣谷芹  22.0      女  理科五班"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stuDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "5a37b0f2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>1.000000e+03</td>\n",
       "      <td>1000.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>1.500101e+09</td>\n",
       "      <td>22.521000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>2.888194e+02</td>\n",
       "      <td>1.113013</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1.500100e+09</td>\n",
       "      <td>21.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>1.500100e+09</td>\n",
       "      <td>22.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>1.500101e+09</td>\n",
       "      <td>22.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>1.500101e+09</td>\n",
       "      <td>24.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>1.500101e+09</td>\n",
       "      <td>24.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 id          age\n",
       "count  1.000000e+03  1000.000000\n",
       "mean   1.500101e+09    22.521000\n",
       "std    2.888194e+02     1.113013\n",
       "min    1.500100e+09    21.000000\n",
       "25%    1.500100e+09    22.000000\n",
       "50%    1.500101e+09    22.000000\n",
       "75%    1.500101e+09    24.000000\n",
       "max    1.500101e+09    24.000000"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stuDF.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "f5741215",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.021497</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>age</th>\n",
       "      <td>0.021497</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           id       age\n",
       "id   1.000000  0.021497\n",
       "age  0.021497  1.000000"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stuDF.corr()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "ddc19990",
   "metadata": {},
   "outputs": [],
   "source": [
    "stuDF.loc[0,'age'] = 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "a06802df",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>clazz</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>施笑槐</td>\n",
       "      <td>24.0</td>\n",
       "      <td>女</td>\n",
       "      <td>文科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100002</td>\n",
       "      <td>吕金鹏</td>\n",
       "      <td>24.0</td>\n",
       "      <td>男</td>\n",
       "      <td>文科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100003</td>\n",
       "      <td>单乐蕊</td>\n",
       "      <td>22.0</td>\n",
       "      <td>女</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100004</td>\n",
       "      <td>葛德曜</td>\n",
       "      <td>24.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科三班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100005</td>\n",
       "      <td>宣谷芹</td>\n",
       "      <td>22.0</td>\n",
       "      <td>女</td>\n",
       "      <td>理科五班</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           id name   age gender clazz\n",
       "0  1500100001  施笑槐  24.0      女  文科六班\n",
       "1  1500100002  吕金鹏  24.0      男  文科六班\n",
       "2  1500100003  单乐蕊  22.0      女  理科六班\n",
       "3  1500100004  葛德曜  24.0      男  理科三班\n",
       "4  1500100005  宣谷芹  22.0      女  理科五班"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stuDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "6ae7dfb4",
   "metadata": {},
   "outputs": [],
   "source": [
    "stuDF.loc[0:4,'age'] = 23"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "a0295238",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>clazz</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>施笑槐</td>\n",
       "      <td>23.0</td>\n",
       "      <td>女</td>\n",
       "      <td>文科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100002</td>\n",
       "      <td>吕金鹏</td>\n",
       "      <td>23.0</td>\n",
       "      <td>男</td>\n",
       "      <td>文科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100003</td>\n",
       "      <td>单乐蕊</td>\n",
       "      <td>23.0</td>\n",
       "      <td>女</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100004</td>\n",
       "      <td>葛德曜</td>\n",
       "      <td>23.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科三班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100005</td>\n",
       "      <td>宣谷芹</td>\n",
       "      <td>23.0</td>\n",
       "      <td>女</td>\n",
       "      <td>理科五班</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           id name   age gender clazz\n",
       "0  1500100001  施笑槐  23.0      女  文科六班\n",
       "1  1500100002  吕金鹏  23.0      男  文科六班\n",
       "2  1500100003  单乐蕊  23.0      女  理科六班\n",
       "3  1500100004  葛德曜  23.0      男  理科三班\n",
       "4  1500100005  宣谷芹  23.0      女  理科五班"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stuDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "ce0b147f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>clazz</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100002</td>\n",
       "      <td>吕金鹏</td>\n",
       "      <td>23.0</td>\n",
       "      <td>男</td>\n",
       "      <td>文科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100004</td>\n",
       "      <td>葛德曜</td>\n",
       "      <td>23.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科三班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1500100006</td>\n",
       "      <td>边昂雄</td>\n",
       "      <td>21.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科二班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1500100009</td>\n",
       "      <td>沈德昌</td>\n",
       "      <td>21.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科一班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1500100010</td>\n",
       "      <td>羿彦昌</td>\n",
       "      <td>23.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>991</th>\n",
       "      <td>1500100992</td>\n",
       "      <td>莫运盛</td>\n",
       "      <td>24.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>995</th>\n",
       "      <td>1500100996</td>\n",
       "      <td>厉运凡</td>\n",
       "      <td>24.0</td>\n",
       "      <td>男</td>\n",
       "      <td>文科三班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>996</th>\n",
       "      <td>1500100997</td>\n",
       "      <td>陶敬曦</td>\n",
       "      <td>21.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>997</th>\n",
       "      <td>1500100998</td>\n",
       "      <td>容昆宇</td>\n",
       "      <td>22.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科四班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>999</th>\n",
       "      <td>1500101000</td>\n",
       "      <td>符瑞渊</td>\n",
       "      <td>23.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>507 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             id name   age gender clazz\n",
       "1    1500100002  吕金鹏  23.0      男  文科六班\n",
       "3    1500100004  葛德曜  23.0      男  理科三班\n",
       "5    1500100006  边昂雄  21.0      男  理科二班\n",
       "8    1500100009  沈德昌  21.0      男  理科一班\n",
       "9    1500100010  羿彦昌  23.0      男  理科六班\n",
       "..          ...  ...   ...    ...   ...\n",
       "991  1500100992  莫运盛  24.0      男  理科六班\n",
       "995  1500100996  厉运凡  24.0      男  文科三班\n",
       "996  1500100997  陶敬曦  21.0      男  理科六班\n",
       "997  1500100998  容昆宇  22.0      男  理科四班\n",
       "999  1500101000  符瑞渊  23.0      男  理科六班\n",
       "\n",
       "[507 rows x 5 columns]"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 过滤\n",
    "stuDF[stuDF['gender'] == '男']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "b5d1c5ed",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>clazz</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>1500100013</td>\n",
       "      <td>逯君昊</td>\n",
       "      <td>24.0</td>\n",
       "      <td>男</td>\n",
       "      <td>文科二班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>1500100019</td>\n",
       "      <td>娄曦之</td>\n",
       "      <td>24.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科三班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>1500100028</td>\n",
       "      <td>幸浩邈</td>\n",
       "      <td>24.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科五班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>1500100031</td>\n",
       "      <td>麻智刚</td>\n",
       "      <td>24.0</td>\n",
       "      <td>男</td>\n",
       "      <td>文科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>1500100032</td>\n",
       "      <td>雍静枫</td>\n",
       "      <td>24.0</td>\n",
       "      <td>女</td>\n",
       "      <td>文科二班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>988</th>\n",
       "      <td>1500100989</td>\n",
       "      <td>柏盼香</td>\n",
       "      <td>24.0</td>\n",
       "      <td>女</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>991</th>\n",
       "      <td>1500100992</td>\n",
       "      <td>莫运盛</td>\n",
       "      <td>24.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科六班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>993</th>\n",
       "      <td>1500100994</td>\n",
       "      <td>相凌青</td>\n",
       "      <td>24.0</td>\n",
       "      <td>女</td>\n",
       "      <td>理科四班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>994</th>\n",
       "      <td>1500100995</td>\n",
       "      <td>寿芷卉</td>\n",
       "      <td>24.0</td>\n",
       "      <td>女</td>\n",
       "      <td>理科五班</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>995</th>\n",
       "      <td>1500100996</td>\n",
       "      <td>厉运凡</td>\n",
       "      <td>24.0</td>\n",
       "      <td>男</td>\n",
       "      <td>文科三班</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>258 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             id name   age gender clazz\n",
       "12   1500100013  逯君昊  24.0      男  文科二班\n",
       "18   1500100019  娄曦之  24.0      男  理科三班\n",
       "27   1500100028  幸浩邈  24.0      男  理科五班\n",
       "30   1500100031  麻智刚  24.0      男  文科六班\n",
       "31   1500100032  雍静枫  24.0      女  文科二班\n",
       "..          ...  ...   ...    ...   ...\n",
       "988  1500100989  柏盼香  24.0      女  理科六班\n",
       "991  1500100992  莫运盛  24.0      男  理科六班\n",
       "993  1500100994  相凌青  24.0      女  理科四班\n",
       "994  1500100995  寿芷卉  24.0      女  理科五班\n",
       "995  1500100996  厉运凡  24.0      男  文科三班\n",
       "\n",
       "[258 rows x 5 columns]"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stuDF[stuDF['age']>23]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "58a84c96",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 分组 聚合\n",
    "# 统计班级人数\n",
    "clazz_num = stuDF.groupby('clazz')['id'].count().reset_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "14b6a603",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>clazz</th>\n",
       "      <th>id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>文科一班</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>文科三班</td>\n",
       "      <td>94</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>文科二班</td>\n",
       "      <td>87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>文科五班</td>\n",
       "      <td>84</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>文科六班</td>\n",
       "      <td>104</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>文科四班</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>理科一班</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>理科三班</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>理科二班</td>\n",
       "      <td>79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>理科五班</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>理科六班</td>\n",
       "      <td>92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>理科四班</td>\n",
       "      <td>91</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   clazz   id\n",
       "0   文科一班   72\n",
       "1   文科三班   94\n",
       "2   文科二班   87\n",
       "3   文科五班   84\n",
       "4   文科六班  104\n",
       "5   文科四班   81\n",
       "6   理科一班   78\n",
       "7   理科三班   68\n",
       "8   理科二班   79\n",
       "9   理科五班   70\n",
       "10  理科六班   92\n",
       "11  理科四班   91"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clazz_num.head(20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "2f273ff9",
   "metadata": {},
   "outputs": [],
   "source": [
    "clazz_num.to_csv(\"../data/clazz_num.csv\",encoding='utf8',index=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "b85b6cf1",
   "metadata": {},
   "outputs": [],
   "source": [
    "clazz_gender_cnt = stuDF.groupby(['clazz','gender'])['id'].agg('count').reset_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "e8b3b34a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>clazz</th>\n",
       "      <th>gender</th>\n",
       "      <th>id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>文科一班</td>\n",
       "      <td>女</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>文科一班</td>\n",
       "      <td>男</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>文科三班</td>\n",
       "      <td>女</td>\n",
       "      <td>44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>文科三班</td>\n",
       "      <td>男</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>文科二班</td>\n",
       "      <td>女</td>\n",
       "      <td>38</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  clazz gender  id\n",
       "0  文科一班      女  41\n",
       "1  文科一班      男  31\n",
       "2  文科三班      女  44\n",
       "3  文科三班      男  50\n",
       "4  文科二班      女  38"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clazz_gender_cnt.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "f2a7dec5",
   "metadata": {},
   "outputs": [],
   "source": [
    "clazz_gender_cnt.rename(columns={\"id\":\"cnt\"},inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "634af665",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>clazz</th>\n",
       "      <th>gender</th>\n",
       "      <th>cnt</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>文科一班</td>\n",
       "      <td>女</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>文科一班</td>\n",
       "      <td>男</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>文科三班</td>\n",
       "      <td>女</td>\n",
       "      <td>44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>文科三班</td>\n",
       "      <td>男</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>文科二班</td>\n",
       "      <td>女</td>\n",
       "      <td>38</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  clazz gender  cnt\n",
       "0  文科一班      女   41\n",
       "1  文科一班      男   31\n",
       "2  文科三班      女   44\n",
       "3  文科三班      男   50\n",
       "4  文科二班      女   38"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clazz_gender_cnt.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "c08ab1a1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>clazz</th>\n",
       "      <th>gender</th>\n",
       "      <th>cnt</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>理科六班</td>\n",
       "      <td>男</td>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>文科六班</td>\n",
       "      <td>男</td>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>理科四班</td>\n",
       "      <td>男</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>文科三班</td>\n",
       "      <td>男</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>文科六班</td>\n",
       "      <td>女</td>\n",
       "      <td>49</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>文科二班</td>\n",
       "      <td>男</td>\n",
       "      <td>49</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>理科一班</td>\n",
       "      <td>女</td>\n",
       "      <td>47</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>文科三班</td>\n",
       "      <td>女</td>\n",
       "      <td>44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>文科五班</td>\n",
       "      <td>男</td>\n",
       "      <td>43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>理科二班</td>\n",
       "      <td>女</td>\n",
       "      <td>43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>文科四班</td>\n",
       "      <td>女</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>文科五班</td>\n",
       "      <td>女</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>理科四班</td>\n",
       "      <td>女</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>文科一班</td>\n",
       "      <td>女</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>文科四班</td>\n",
       "      <td>男</td>\n",
       "      <td>39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>文科二班</td>\n",
       "      <td>女</td>\n",
       "      <td>38</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>理科五班</td>\n",
       "      <td>女</td>\n",
       "      <td>37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>理科六班</td>\n",
       "      <td>女</td>\n",
       "      <td>37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>理科二班</td>\n",
       "      <td>男</td>\n",
       "      <td>36</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>理科三班</td>\n",
       "      <td>男</td>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>理科三班</td>\n",
       "      <td>女</td>\n",
       "      <td>33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>理科五班</td>\n",
       "      <td>男</td>\n",
       "      <td>33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>理科一班</td>\n",
       "      <td>男</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>文科一班</td>\n",
       "      <td>男</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   clazz gender  cnt\n",
       "0   理科六班      男   55\n",
       "1   文科六班      男   55\n",
       "2   理科四班      男   50\n",
       "3   文科三班      男   50\n",
       "4   文科六班      女   49\n",
       "5   文科二班      男   49\n",
       "6   理科一班      女   47\n",
       "7   文科三班      女   44\n",
       "8   文科五班      男   43\n",
       "9   理科二班      女   43\n",
       "10  文科四班      女   42\n",
       "11  文科五班      女   41\n",
       "12  理科四班      女   41\n",
       "13  文科一班      女   41\n",
       "14  文科四班      男   39\n",
       "15  文科二班      女   38\n",
       "16  理科五班      女   37\n",
       "17  理科六班      女   37\n",
       "18  理科二班      男   36\n",
       "19  理科三班      男   35\n",
       "20  理科三班      女   33\n",
       "21  理科五班      男   33\n",
       "22  理科一班      男   31\n",
       "23  文科一班      男   31"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clazz_gender_cnt.sort_values('cnt',ascending=False).reset_index().drop('index',axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "ec2bf492",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 关联\n",
    "scoreDF = pd.read_csv(\"../data/score.txt\",header=None,names=['sid','subject_id','score'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "492c442b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sid</th>\n",
       "      <th>subject_id</th>\n",
       "      <th>score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000001</td>\n",
       "      <td>98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000002</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000003</td>\n",
       "      <td>137</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000004</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000005</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          sid  subject_id  score\n",
       "0  1500100001     1000001     98\n",
       "1  1500100001     1000002      5\n",
       "2  1500100001     1000003    137\n",
       "3  1500100001     1000004     29\n",
       "4  1500100001     1000005     85"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "scoreDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "bc02009b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# scoreDF['sid'] = scoreDF['sid'].astype('str')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "4251e57e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>clazz</th>\n",
       "      <th>sid</th>\n",
       "      <th>subject_id</th>\n",
       "      <th>score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>施笑槐</td>\n",
       "      <td>23.0</td>\n",
       "      <td>女</td>\n",
       "      <td>文科六班</td>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000001</td>\n",
       "      <td>98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>施笑槐</td>\n",
       "      <td>23.0</td>\n",
       "      <td>女</td>\n",
       "      <td>文科六班</td>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000002</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>施笑槐</td>\n",
       "      <td>23.0</td>\n",
       "      <td>女</td>\n",
       "      <td>文科六班</td>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000003</td>\n",
       "      <td>137</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>施笑槐</td>\n",
       "      <td>23.0</td>\n",
       "      <td>女</td>\n",
       "      <td>文科六班</td>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000004</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>施笑槐</td>\n",
       "      <td>23.0</td>\n",
       "      <td>女</td>\n",
       "      <td>文科六班</td>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000005</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5995</th>\n",
       "      <td>1500101000</td>\n",
       "      <td>符瑞渊</td>\n",
       "      <td>23.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科六班</td>\n",
       "      <td>1500101000</td>\n",
       "      <td>1000002</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5996</th>\n",
       "      <td>1500101000</td>\n",
       "      <td>符瑞渊</td>\n",
       "      <td>23.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科六班</td>\n",
       "      <td>1500101000</td>\n",
       "      <td>1000003</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5997</th>\n",
       "      <td>1500101000</td>\n",
       "      <td>符瑞渊</td>\n",
       "      <td>23.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科六班</td>\n",
       "      <td>1500101000</td>\n",
       "      <td>1000007</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5998</th>\n",
       "      <td>1500101000</td>\n",
       "      <td>符瑞渊</td>\n",
       "      <td>23.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科六班</td>\n",
       "      <td>1500101000</td>\n",
       "      <td>1000008</td>\n",
       "      <td>87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5999</th>\n",
       "      <td>1500101000</td>\n",
       "      <td>符瑞渊</td>\n",
       "      <td>23.0</td>\n",
       "      <td>男</td>\n",
       "      <td>理科六班</td>\n",
       "      <td>1500101000</td>\n",
       "      <td>1000009</td>\n",
       "      <td>28</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>6000 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              id name   age gender clazz         sid  subject_id  score\n",
       "0     1500100001  施笑槐  23.0      女  文科六班  1500100001     1000001     98\n",
       "1     1500100001  施笑槐  23.0      女  文科六班  1500100001     1000002      5\n",
       "2     1500100001  施笑槐  23.0      女  文科六班  1500100001     1000003    137\n",
       "3     1500100001  施笑槐  23.0      女  文科六班  1500100001     1000004     29\n",
       "4     1500100001  施笑槐  23.0      女  文科六班  1500100001     1000005     85\n",
       "...          ...  ...   ...    ...   ...         ...         ...    ...\n",
       "5995  1500101000  符瑞渊  23.0      男  理科六班  1500101000     1000002     78\n",
       "5996  1500101000  符瑞渊  23.0      男  理科六班  1500101000     1000003     81\n",
       "5997  1500101000  符瑞渊  23.0      男  理科六班  1500101000     1000007      5\n",
       "5998  1500101000  符瑞渊  23.0      男  理科六班  1500101000     1000008     87\n",
       "5999  1500101000  符瑞渊  23.0      男  理科六班  1500101000     1000009     28\n",
       "\n",
       "[6000 rows x 8 columns]"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stuDF.merge(scoreDF,left_on='id',right_on='sid',how='inner')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "3a8c993b",
   "metadata": {},
   "outputs": [],
   "source": [
    "sdf1 = scoreDF.loc[0:2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "b6bd82fa",
   "metadata": {},
   "outputs": [],
   "source": [
    "sdf2 = scoreDF.loc[2:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "392350d1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sid</th>\n",
       "      <th>subject_id</th>\n",
       "      <th>score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000003</td>\n",
       "      <td>137</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000004</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000005</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000006</td>\n",
       "      <td>52</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          sid  subject_id  score\n",
       "2  1500100001     1000003    137\n",
       "3  1500100001     1000004     29\n",
       "4  1500100001     1000005     85\n",
       "5  1500100001     1000006     52"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sdf2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "8e48b6db",
   "metadata": {},
   "outputs": [],
   "source": [
    "sdf12 = pd.concat([sdf1,sdf2]) # 相当于 union"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "347d3c8f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sid</th>\n",
       "      <th>subject_id</th>\n",
       "      <th>score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000001</td>\n",
       "      <td>98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000002</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000003</td>\n",
       "      <td>137</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000003</td>\n",
       "      <td>137</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000004</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000005</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000006</td>\n",
       "      <td>52</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          sid  subject_id  score\n",
       "0  1500100001     1000001     98\n",
       "1  1500100001     1000002      5\n",
       "2  1500100001     1000003    137\n",
       "2  1500100001     1000003    137\n",
       "3  1500100001     1000004     29\n",
       "4  1500100001     1000005     85\n",
       "5  1500100001     1000006     52"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sdf12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "6f31e502",
   "metadata": {},
   "outputs": [],
   "source": [
    "sdf12.drop_duplicates(['sid','subject_id'],inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "9983a951",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sid</th>\n",
       "      <th>subject_id</th>\n",
       "      <th>score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000001</td>\n",
       "      <td>98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000002</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000003</td>\n",
       "      <td>137</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000004</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000005</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000006</td>\n",
       "      <td>52</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          sid  subject_id  score\n",
       "0  1500100001     1000001     98\n",
       "1  1500100001     1000002      5\n",
       "2  1500100001     1000003    137\n",
       "3  1500100001     1000004     29\n",
       "4  1500100001     1000005     85\n",
       "5  1500100001     1000006     52"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sdf12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "2cf0686e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sid</th>\n",
       "      <th>subject_id</th>\n",
       "      <th>score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000001</td>\n",
       "      <td>98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000002</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000003</td>\n",
       "      <td>137</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000004</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>1000005</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          sid  subject_id  score\n",
       "0  1500100001     1000001     98\n",
       "1  1500100001     1000002      5\n",
       "2  1500100001     1000003    137\n",
       "3  1500100001     1000004     29\n",
       "4  1500100001     1000005     85"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "scoreDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "cfaf063c",
   "metadata": {},
   "outputs": [],
   "source": [
    "sum_score = scoreDF.groupby('sid')['score'].sum().reset_index().rename(columns={'score':'sum_score'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "d4efadb9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sid</th>\n",
       "      <th>sum_score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>406</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100002</td>\n",
       "      <td>440</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100003</td>\n",
       "      <td>359</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100004</td>\n",
       "      <td>421</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100005</td>\n",
       "      <td>395</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          sid  sum_score\n",
       "0  1500100001        406\n",
       "1  1500100002        440\n",
       "2  1500100003        359\n",
       "3  1500100004        421\n",
       "4  1500100005        395"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum_score.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "id": "264a8e50",
   "metadata": {},
   "outputs": [],
   "source": [
    "stu_sum_scoreDF = stuDF.merge(sum_score,left_on='id',right_on='sid',how='inner')[['id','name','clazz','sum_score']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "73e992f4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>clazz</th>\n",
       "      <th>sum_score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>施笑槐</td>\n",
       "      <td>文科六班</td>\n",
       "      <td>406</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100002</td>\n",
       "      <td>吕金鹏</td>\n",
       "      <td>文科六班</td>\n",
       "      <td>440</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100003</td>\n",
       "      <td>单乐蕊</td>\n",
       "      <td>理科六班</td>\n",
       "      <td>359</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100004</td>\n",
       "      <td>葛德曜</td>\n",
       "      <td>理科三班</td>\n",
       "      <td>421</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100005</td>\n",
       "      <td>宣谷芹</td>\n",
       "      <td>理科五班</td>\n",
       "      <td>395</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           id name clazz  sum_score\n",
       "0  1500100001  施笑槐  文科六班        406\n",
       "1  1500100002  吕金鹏  文科六班        440\n",
       "2  1500100003  单乐蕊  理科六班        359\n",
       "3  1500100004  葛德曜  理科三班        421\n",
       "4  1500100005  宣谷芹  理科五班        395"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stu_sum_scoreDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "id": "2e988b02",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 统计班级前三 topn\n",
    "stu_sum_scoreDF['rank']=stu_sum_scoreDF.groupby('clazz')['sum_score'].rank(method='first',ascending=False)\n",
    "stu_sum_scoreDF['rank_min']=stu_sum_scoreDF.groupby('clazz')['sum_score'].rank(method='min',ascending=False)\n",
    "stu_sum_scoreDF['rank_max']=stu_sum_scoreDF.groupby('clazz')['sum_score'].rank(method='max',ascending=False)\n",
    "stu_sum_scoreDF['rank_dense']=stu_sum_scoreDF.groupby('clazz')['sum_score'].rank(method='dense',ascending=False)\n",
    "stu_sum_scoreDF['rank_avg']=stu_sum_scoreDF.groupby('clazz')['sum_score'].rank(method='average',ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "id": "aa1c8333",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>clazz</th>\n",
       "      <th>sum_score</th>\n",
       "      <th>rank</th>\n",
       "      <th>rank_min</th>\n",
       "      <th>rank_max</th>\n",
       "      <th>rank_avg</th>\n",
       "      <th>rank_dense</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1500100001</td>\n",
       "      <td>施笑槐</td>\n",
       "      <td>文科六班</td>\n",
       "      <td>406</td>\n",
       "      <td>39.0</td>\n",
       "      <td>39.0</td>\n",
       "      <td>39.0</td>\n",
       "      <td>39.0</td>\n",
       "      <td>34.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1500100002</td>\n",
       "      <td>吕金鹏</td>\n",
       "      <td>文科六班</td>\n",
       "      <td>440</td>\n",
       "      <td>24.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>22.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1500100003</td>\n",
       "      <td>单乐蕊</td>\n",
       "      <td>理科六班</td>\n",
       "      <td>359</td>\n",
       "      <td>47.0</td>\n",
       "      <td>47.0</td>\n",
       "      <td>48.0</td>\n",
       "      <td>47.5</td>\n",
       "      <td>43.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1500100004</td>\n",
       "      <td>葛德曜</td>\n",
       "      <td>理科三班</td>\n",
       "      <td>421</td>\n",
       "      <td>20.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>19.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1500100005</td>\n",
       "      <td>宣谷芹</td>\n",
       "      <td>理科五班</td>\n",
       "      <td>395</td>\n",
       "      <td>34.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>34.5</td>\n",
       "      <td>29.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           id name clazz  sum_score  rank  rank_min  rank_max  rank_avg  \\\n",
       "0  1500100001  施笑槐  文科六班        406  39.0      39.0      39.0      39.0   \n",
       "1  1500100002  吕金鹏  文科六班        440  24.0      24.0      24.0      24.0   \n",
       "2  1500100003  单乐蕊  理科六班        359  47.0      47.0      48.0      47.5   \n",
       "3  1500100004  葛德曜  理科三班        421  20.0      20.0      20.0      20.0   \n",
       "4  1500100005  宣谷芹  理科五班        395  34.0      34.0      35.0      34.5   \n",
       "\n",
       "   rank_dense  \n",
       "0        34.0  \n",
       "1        22.0  \n",
       "2        43.0  \n",
       "3        19.0  \n",
       "4        29.0  "
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stu_sum_scoreDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "id": "efee8f52",
   "metadata": {},
   "outputs": [],
   "source": [
    "clazz_top3_DF = stu_sum_scoreDF[stu_sum_scoreDF['rank']<=3].sort_values(['clazz','rank'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "id": "043543c7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>clazz</th>\n",
       "      <th>sum_score</th>\n",
       "      <th>rank</th>\n",
       "      <th>rank_min</th>\n",
       "      <th>rank_max</th>\n",
       "      <th>rank_avg</th>\n",
       "      <th>rank_dense</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>307</th>\n",
       "      <td>1500100308</td>\n",
       "      <td>黄初夏</td>\n",
       "      <td>文科一班</td>\n",
       "      <td>628</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>874</th>\n",
       "      <td>1500100875</td>\n",
       "      <td>马向南</td>\n",
       "      <td>文科一班</td>\n",
       "      <td>595</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>942</th>\n",
       "      <td>1500100943</td>\n",
       "      <td>许昌黎</td>\n",
       "      <td>文科一班</td>\n",
       "      <td>580</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159</th>\n",
       "      <td>1500100160</td>\n",
       "      <td>云冰真</td>\n",
       "      <td>文科三班</td>\n",
       "      <td>568</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>433</th>\n",
       "      <td>1500100434</td>\n",
       "      <td>黎雨珍</td>\n",
       "      <td>文科三班</td>\n",
       "      <td>550</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.5</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             id name clazz  sum_score  rank  rank_min  rank_max  rank_avg  \\\n",
       "307  1500100308  黄初夏  文科一班        628   1.0       1.0       1.0       1.0   \n",
       "874  1500100875  马向南  文科一班        595   2.0       2.0       2.0       2.0   \n",
       "942  1500100943  许昌黎  文科一班        580   3.0       3.0       3.0       3.0   \n",
       "159  1500100160  云冰真  文科三班        568   1.0       1.0       1.0       1.0   \n",
       "433  1500100434  黎雨珍  文科三班        550   2.0       2.0       3.0       2.5   \n",
       "\n",
       "     rank_dense  \n",
       "307         1.0  \n",
       "874         2.0  \n",
       "942         3.0  \n",
       "159         1.0  \n",
       "433         2.0  "
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clazz_top3_DF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "id": "f4c07c8c",
   "metadata": {},
   "outputs": [],
   "source": [
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "id": "5cce9eda",
   "metadata": {},
   "outputs": [],
   "source": [
    "# windows解决中文乱码\n",
    "plt.rcParams['font.sans-serif']=['SimHei'] # 用来正常显示中文标签\n",
    "\n",
    "# mac解决中文乱码\n",
    "# plt.rcParams['font.sans-serif'] = ['Arial Unicode MS']\n",
    "\n",
    "plt.rcParams['axes.unicode_minus']=False # 用来正常显示负号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "id": "0234fd97",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA3UAAAHtCAYAAAC+pFcnAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIH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KcleSPWmvfnOFnOz+D6+/On8n7AECoA2DBqqot1456Da+T26G1tnrK+sUZTJZy62boy/kR6gDYCEIdAABAx1xTBwAA0DGhDgAAoGNCHQAAQMe6uPn4jjvu2JYtWzbb3QAAAJgVq1at+l5rbadR67oIdcuWLcvKlStnuxsAAACzoqpu3tA6p18CAAB0TKgDAADomFAHAADQsS6uqQMAAPhhHn300dx666156KGHZrsrm2SrrbbK7rvvnsWLF0/7PUIdAADQvVtvvTXbbrttli1blqqa7e5slNZa7rzzztx6663Zc889p/0+p18CAADde+ihh7LDDjt0G+iSpKqyww47zHi0UagDAADmhZ4D3Vob8xmEOgAAgE1w/vnn5/zzz5+1/Qt1AAAAHTNRCgAAQJIjjzwyz3ve83LdddflC1/4QtasWZPjjz8+Dz30UPbYY4985CMfybve9a48+uijueKKK3Lvvffm4osvfuL9X//613PqqafmM5/5TLbddtvN1m8jdQAAAEmuvvrqvOAFL8gXvvCFJMl3vvOdvPnNb85FF12Um266KXfccUeS5Fvf+la+9KUv5Rd/8Rdz2WWXPbHt61//+nz84x/frIEuEeoAAACSJPvuu29e9apXPfF68eLF+dCHPpTXv/71ueuuu/Lggw8mSU488cQkyTOf+cw88sgjSZJzzjknu+++e26++ebN3m+hDgAAIMmSJUt+4PV5552XV7/61fnEJz6RbbbZ5onlU5+v9c53vjMf/OAH8853vnPi/VyXUAcAADDCS17ykpx55pk56qijkiS33XbbBrfdaqutsnTp0uy999757Gc/u7m6mCSp1tpm3eHGWL58eVu5cuVsdwMAAJijbrjhhuyzzz6z3Y2xGPVZqmpVa235qO2N1AEAAHRMqAMAAOiYUAcAANAxoQ4AAKBjQh0AAEDHtpjtDgAAAIzbgaddMNb2Vp114ljbGycjdQAAAGNyxx135PDDD9/g+kcffTSveMUrcsghh+TDH/7wWPYp1AEAAIzB3XffnZNOOikPPPDABrc5++yzs3z58lx11VX5/Oc/n/vvv3+T9yvUAQAAjMGiRYty4YUXZrvtttvgNitWrMjxxx+fJDnkkEOycuXKTd6va+oAAADG4IeFubUeeOCB7Lbbbk9sf8cdd2zyfo3UAQAAbCZLlizJgw8+mCRZs2ZNHn/88U1uU6gDAADYTA488MBcccUVSZJrr702y5Yt2+Q2nX4JAADMO3PhFgSXXXZZvvGNb+Qtb3nLE8tOOumkHHPMMbn88svzjW98I89//vM3eT8TG6mrqg9W1SuraouquqWqVgwf+w3X/05VfaWqzplUHwAAADa3FStWJEmOOuqoHwh0SbLHHnvkkksuyaGHHppLL700ixYt2uT9TSTUVdXhSXZprX0uybOTfKK1duTwcX1VLU9yWJKDktxaVUdPoh8AAABzza677prjjz8+T3/608fS3thDXVUtTvKnSW6qql9IcnCS46rqiqr6WFVtkeSIJJ9qrbUklyZZ7+58VXVKVa2sqpWrV68edzcBAADmhUmM1J2Y5BtJfi+DkbgdkrywtXZYknuSHJNkmyS3Dbe/L8nO6zbSWju3tba8tbZ8p512mkA3AQAA+jeJUHdAknNba99N8udJntta+85w3TeT7JVkTZKth8uWTKgfAAAA894kZr/8VpJnDZ8vT5Kq2j/J15Icl+S/J3kkyfFJ/iLJ/klumkA/AACABeqWM/Yba3tLT79+rO2N0yRC3XlJPlxVJyRZnORtST6apJJ8trV2aVU9JcmZVfX+JC8bPgAAALp177335oQTTsj3v//9LFmyJBdeeGG23HLL9bY7+eSTc8MNN+SYY47JO97xjk3e79hPe2yt3d9ae01r7YjW2gtaa19qrT27tbZfa+3tw20eT3J0ksuT/Fxr7dvj7gcAAMDm9LGPfSy/8Ru/kUsuuSS77LJLLr744vW2+fSnP53HHnssV111VW6//fbceOONm7zfWbv5eGvtwSSfnK39AwAAjNOb3vSmJ56vXr06z3zmM9fbZsWKFTn++OOTDO5jd8UVV2SvvfbapP2aoAQAAGCM/u7v/i533313Dj744PXWPfDAA9ltt92SJNttt13uuOOOTd7frI3UAQAAzDd33XVXTj311HzqU58auX7JkiV58MEHkyRr1qzJ448/vsn7NFIHAAAwBo888kiOP/74nHnmmdljjz1GbnPggQfmiiuuSJJce+21WbZs2Sbv10gdAAAw78zGLQjOO++8rFq1Ku9+97vz7ne/Oy960Yvy6KOP5nd/93ef2ObYY4/N4Ycfnttvvz0XXXRRrr766k3eb7XWNrmRSVu+fHlbuXLlbHcDAACYo2644Ybss88+s92Nabn77rtzySWX5Igjjsguu+yy3vpRn6WqVrXWlo9qz0gdAADAZrT99ts/MQPmOLimDgAAoGNCHQAAQMeEOgAAgI65pg4AAJh3Dj370LG2d+WpV05ru7vuuiurVq3KAQcckB133HGsfdgQI3UAAABj8J3vfCcvf/nLc8011+RFL3pRVq9ePXK7k08+OYcccsgP3OpgUwh1AAAAY/D1r38973vf+/L2t789L33pS/PVr351vW0+/elP57HHHstVV12V22+/PTfeeOMm71eoAwAAGIOjjz46Bx98cL785S/nmmuuyQte8IL1tlmxYsUTtzM46qijcsUVV2zyfoU6AACAMWmt5cILL8zixYuzaNGi9dY/8MAD2W233ZIk2223Xe64445N3qdQBwAAMCZVlQ984AM55JBD8vnPf3699UuWLMmDDz6YJFmzZk0ef/zxTd6nUAcAADAG733ve3PBBRckSe6555484xnPWG+bAw888IlTLq+99tosW7Zsk/frlgYAAMC8M91bEIzTKaeckuOPPz4f+tCHsu+++2b33XfPO97xjh+Y5fLYY4/N4Ycfnttvvz0XXXRRrr766k3eb7XWNrmRSVu+fHlbuXLlbHcDAACYo2644Ybss88+s92Nabn77rtzySWX5Igjjsguu+yy3vpRn6WqVrXWlo9qz0gdAADAZrT99ts/MQPmOLimDgAAmBd6OAvxyWzMZxDqAACA7m211Va58847uw52rbXceeed2WqrrWb0PqdfAgAA3dt9991z6623ZvXq1bPdlU2y1VZbZffdd5/Re4Q6AACge4sXL86ee+45292YFU6/BAAA6JhQBwAA0DGnXwIAE3HgaReMpZ1VZ504lnYA5isjdQAAAB0T6gAAADrW/emX4zq1I3F6BwDAbPD/Odg0RuoAAAA6JtQBAAB0TKgDAADomFAHAADQMaEOAACgY0IdAABAx4Q6AACAjgl1AAAAHRPqAAAAOibUAQAAdEyoAwAA6JhQBwAA0DGhDg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zOC83qdlMJz7/SR/mMFvBv5w5p9oPMZZl9baXyT5i2ns8//KHK7LmGvyvgzui/Jk+5zTNUnG/m/oi0kOmvpb4XX2tfZa3+OygOpSVT+SwYHlFW2dSR6S/D9J/mTYxoL62TL0r621Izewr6sz+E/pXK/LdUle1lq7v6pOqqp1J2ioJJ9urX1gIR2HMsa6zJfj0NA46zJfjkXj/Dc0b45DGWNd5tNxKOP/mTvnj0ML4ubjNYjV27TWRv6Ws37IDSjHtP9tkjw6yX1sDHVZn5qMpi6jjbsuNbgf0LTvRbaA6vKM1to9M9h+TtZlrRpxg+xhzZ4yk7//Ge5zTtckUZcNUZf1qclo46jLfDkOTTWmusz549CCCHUAAADz1UK7pQEAAMC8ItQBAAB0TKgDgCmqasVs9wEAZkKoAwAA6JhQB8CCVFVbVdVfVNUVVfX5qnraiG2WVNVfV9VlVfWR4bKjqmrF8PFwVe06atnm/0QALFQL4j51ADDCKUmuba2dUFW/lGTfDG5UO9WPJvlAkkszuPHszq21y5JcVlW/nGRVa+32JLePWAYAm4VQB8BCtXeSTw2fn7+BbR5N8stJfinJjyTZOnniBusnJHnZ2g1HLQOAzcHplwAsVN9M8rzh89/OILyt6+Qkn0zyuiQPJElVPT3J/0hyUmvt+xtaBgCbi1AHwEJ1bpLnDme7fG6Sj47Y5pIk/zXJZcPXuyV5U5Ldk3xseA3dCzewDAA2i2qtzXYfAAAA2EhG6gAAADom1AEAAHRMqAMAAOiYUAcAANAxoQ4AAKBjQh0AAEDH/n+AqLMebd+DrgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1080x576 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(15,8))\n",
    "plt.title(\"学生成绩top3\")\n",
    "sns.barplot(x=\"clazz\", y=\"sum_score\", hue=\"rank\", data=clazz_top3_DF)\n",
    "plt.ylim([400,670])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "id": "86454f6e",
   "metadata": {},
   "outputs": [],
   "source": [
    "clazz_num.rename(columns={\"id\":\"cnt\"},inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "id": "11316e09",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>clazz</th>\n",
       "      <th>cnt</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>文科一班</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>文科三班</td>\n",
       "      <td>94</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>文科二班</td>\n",
       "      <td>87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>文科五班</td>\n",
       "      <td>84</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>文科六班</td>\n",
       "      <td>104</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>文科四班</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>理科一班</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>理科三班</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>理科二班</td>\n",
       "      <td>79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>理科五班</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>理科六班</td>\n",
       "      <td>92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>理科四班</td>\n",
       "      <td>91</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   clazz  cnt\n",
       "0   文科一班   72\n",
       "1   文科三班   94\n",
       "2   文科二班   87\n",
       "3   文科五班   84\n",
       "4   文科六班  104\n",
       "5   文科四班   81\n",
       "6   理科一班   78\n",
       "7   理科三班   68\n",
       "8   理科二班   79\n",
       "9   理科五班   70\n",
       "10  理科六班   92\n",
       "11  理科四班   91"
      ]
     },
     "execution_count": 115,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clazz_num"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "id": "c7744282",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARoAAADnCAYAAADByJnJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8/fFQqAAAACXBIWXMAAAsTAAALEwEAmpwYAABXAklEQVR4nO2dd3gc1dWH37NVvdiWezfuvYM7piUxkJAQIAUMpBlICIHkCwT4sqQqoQRCHCB0kkAgXwi9GuGCu427jW1sy122LEuy6rY53x+zstWllXa1K2ve59lH0sy9c+9Io9+ce++554iqYmFhYRFNbLHugIWFxdmPJTQWFhZRxxIaCwuLqGMJjYWFRdSxhMbCwiLqWEJjYWERdSyhsbCwiDqW0FhYWEQdS2gsLCyijiU0FhYWUccSGgsLi6hjCY2FhUXUsYTGwsIi6lhCY2FhE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2jHMWPDIJIBv8EUrKpjSdRd2QPOTvGOJyyhaRmRDJr+J8yl3EaJVdD0tiKS4i0iFwPZmOLTH/iSiFRi/r66iMhkzIwXy+gY4h1zLIe9VtKRgqZHkwgH/HYCWn24WautqrnJK2jHAb/bE5bQWMQdlniffVhCY2FhEXWs5W0LC4uoYwmNhYVF1LGExsLCIupYQmNhYRF1LKGxsLCIOpbQWFhYRB1LaCwsLKKOJTQWFhZRxxIaCwuLqGMJjYWFRdSxhMbCwiLqWEJjYWERdSyhsbCwiDqW0FhYWEQdS2gsLCyizv8DRgz6VeamDnQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.pie(clazz_num['cnt'],labels=clazz_num['clazz'],autopct='%.2f%%')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "id": "305169fc",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 数据清洗\n",
    "column_names= ['id', 'name', 'age', 'weight','m0006',\n",
    "                'm0612','m1218','f0006','f0612','f1218']\n",
    "df = pd.read_csv(\"../data/patient_heart_rate.csv\",header=None,names=column_names)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "id": "69ba3535",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>Mickéy Mousé</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>Donald Duck</td>\n",
       "      <td>34.0</td>\n",
       "      <td>154.89lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>Mini Mouse</td>\n",
       "      <td>16.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>Scrooge McDuck</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>Pink Panther</td>\n",
       "      <td>54.0</td>\n",
       "      <td>198.658lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>Huey McDuck</td>\n",
       "      <td>52.0</td>\n",
       "      <td>189lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7.0</td>\n",
       "      <td>Dewey McDuck</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "      <td>75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>Scööpy Doo</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>75</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9.0</td>\n",
       "      <td>Huey McDuck</td>\n",
       "      <td>52.0</td>\n",
       "      <td>189lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    id            name   age      weight m0006 m0612 m1218 f0006 f0612 f1218\n",
       "0  1.0    Mickéy Mousé  56.0       70kgs    72    69    71     -     -     -\n",
       "1  2.0     Donald Duck  34.0   154.89lbs     -     -     -    85    84    76\n",
       "2  3.0      Mini Mouse  16.0         NaN     -     -     -    65    69    72\n",
       "3  4.0  Scrooge McDuck   NaN       78kgs    78    79    72     -     -     -\n",
       "4  5.0    Pink Panther  54.0  198.658lbs     -     -     -    69   NaN    75\n",
       "5  6.0     Huey McDuck  52.0      189lbs     -     -     -    68    75    72\n",
       "6  7.0    Dewey McDuck  19.0       56kgs     -     -     -    71    78    75\n",
       "7  8.0      Scööpy Doo  32.0       78kgs    78    76    75     -     -     -\n",
       "8  NaN             NaN   NaN         NaN   NaN   NaN   NaN   NaN   NaN   NaN\n",
       "9  9.0     Huey McDuck  52.0      189lbs     -     -     -    68    75    72"
      ]
     },
     "execution_count": 125,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "id": "49460d5f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 11 entries, 0 to 10\n",
      "Data columns (total 10 columns):\n",
      " #   Column  Non-Null Count  Dtype  \n",
      "---  ------  --------------  -----  \n",
      " 0   id      10 non-null     float64\n",
      " 1   name    10 non-null     object \n",
      " 2   age     9 non-null      float64\n",
      " 3   weight  9 non-null      object \n",
      " 4   m0006   10 non-null     object \n",
      " 5   m0612   10 non-null     object \n",
      " 6   m1218   10 non-null     object \n",
      " 7   f0006   10 non-null     object \n",
      " 8   f0612   9 non-null      object \n",
      " 9   f1218   10 non-null     object \n",
      "dtypes: float64(2), object(8)\n",
      "memory usage: 1008.0+ bytes\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "id": "e32c1865",
   "metadata": {},
   "outputs": [],
   "source": [
    "df[['first_name','last_name']] = df['name'].str.split(\" \",expand=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "id": "17071b06",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>Mickéy Mousé</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>Donald Duck</td>\n",
       "      <td>34.0</td>\n",
       "      <td>154.89lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>Mini Mouse</td>\n",
       "      <td>16.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>Scrooge McDuck</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>Pink Panther</td>\n",
       "      <td>54.0</td>\n",
       "      <td>198.658lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    id            name   age      weight m0006 m0612 m1218 f0006 f0612 f1218  \\\n",
       "0  1.0    Mickéy Mousé  56.0       70kgs    72    69    71     -     -     -   \n",
       "1  2.0     Donald Duck  34.0   154.89lbs     -     -     -    85    84    76   \n",
       "2  3.0      Mini Mouse  16.0         NaN     -     -     -    65    69    72   \n",
       "3  4.0  Scrooge McDuck   NaN       78kgs    78    79    72     -     -     -   \n",
       "4  5.0    Pink Panther  54.0  198.658lbs     -     -     -    69   NaN    75   \n",
       "\n",
       "  first_name last_name  \n",
       "0     Mickéy     Mousé  \n",
       "1     Donald      Duck  \n",
       "2       Mini     Mouse  \n",
       "3    Scrooge    McDuck  \n",
       "4       Pink   Panther  "
      ]
     },
     "execution_count": 131,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "id": "35fbd56c",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.drop('name',axis=1,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "id": "04180b6e",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>154.89lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>198.658lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    id   age      weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0  1.0  56.0       70kgs    72    69    71     -     -     -     Mickéy   \n",
       "1  2.0  34.0   154.89lbs     -     -     -    85    84    76     Donald   \n",
       "2  3.0  16.0         NaN     -     -     -    65    69    72       Mini   \n",
       "3  4.0   NaN       78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4  5.0  54.0  198.658lbs     -     -     -    69   NaN    75       Pink   \n",
       "\n",
       "  last_name  \n",
       "0     Mousé  \n",
       "1      Duck  \n",
       "2     Mouse  \n",
       "3    McDuck  \n",
       "4   Panther  "
      ]
     },
     "execution_count": 134,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "id": "6fbfcafd",
   "metadata": {},
   "outputs": [],
   "source": [
    "weight_lbs_df = df[df['weight'].str.contains(\"lbs\").fillna(False)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 163,
   "id": "1f67d8bf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>154.89lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>198.658lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>189lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>189lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    id   age      weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "1  2.0  34.0   154.89lbs     -     -     -    85    84    76     Donald   \n",
       "4  5.0  54.0  198.658lbs     -     -     -    69   NaN    75       Pink   \n",
       "5  6.0  52.0      189lbs     -     -     -    68    75    72       Huey   \n",
       "9  9.0  52.0      189lbs     -     -     -    68    75    72       Huey   \n",
       "\n",
       "  last_name  \n",
       "1      Duck  \n",
       "4   Panther  \n",
       "5    McDuck  \n",
       "9    McDuck  "
      ]
     },
     "execution_count": 163,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weight_lbs_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 164,
   "id": "19453487",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1    134.0\n",
       "4    154.0\n",
       "5    152.0\n",
       "9    152.0\n",
       "Name: age, dtype: float64"
      ]
     },
     "execution_count": 164,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weight_lbs_df.age.apply(lambda x:x+100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 165,
   "id": "042fab38",
   "metadata": {},
   "outputs": [],
   "source": [
    "new_weight = weight_lbs_df.weight.apply(lambda x: \"%.2fkgs\" % (float(x[:-3])/2.2) )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 166,
   "id": "0f7eef1b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['70.40kgs', '90.30kgs', '85.91kgs', '85.91kgs'], dtype=object)"
      ]
     },
     "execution_count": 166,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_weight.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 167,
   "id": "b8ee7e99",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\users\\zzk10\\python37\\lib\\site-packages\\pandas\\core\\indexing.py:1773: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  self._setitem_single_column(ilocs[0], value, pi)\n"
     ]
    }
   ],
   "source": [
    "weight_lbs_df.loc[new_weight.index,'weight'] = new_weight.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "id": "72f4ce55",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    id   age    weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "1  2.0  34.0  70.40kgs     -     -     -    85    84    76     Donald   \n",
       "4  5.0  54.0  90.30kgs     -     -     -    69   NaN    75       Pink   \n",
       "5  6.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "9  9.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "\n",
       "  last_name  \n",
       "1      Duck  \n",
       "4   Panther  \n",
       "5    McDuck  \n",
       "9    McDuck  "
      ]
     },
     "execution_count": 169,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weight_lbs_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 170,
   "id": "40f001cf",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.loc[new_weight.index,'weight'] = new_weight.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "id": "aba7142e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "      <td>75</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>75</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scööpy</td>\n",
       "      <td>Doo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    id   age    weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0  1.0  56.0     70kgs    72    69    71     -     -     -     Mickéy   \n",
       "1  2.0  34.0  70.40kgs     -     -     -    85    84    76     Donald   \n",
       "2  3.0  16.0       NaN     -     -     -    65    69    72       Mini   \n",
       "3  4.0   NaN     78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4  5.0  54.0  90.30kgs     -     -     -    69   NaN    75       Pink   \n",
       "5  6.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "6  7.0  19.0     56kgs     -     -     -    71    78    75      Dewey   \n",
       "7  8.0  32.0     78kgs    78    76    75     -     -     -     Scööpy   \n",
       "8  NaN   NaN       NaN   NaN   NaN   NaN   NaN   NaN   NaN        NaN   \n",
       "9  9.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "\n",
       "  last_name  \n",
       "0     Mousé  \n",
       "1      Duck  \n",
       "2     Mouse  \n",
       "3    McDuck  \n",
       "4   Panther  \n",
       "5    McDuck  \n",
       "6    McDuck  \n",
       "7       Doo  \n",
       "8       NaN  \n",
       "9    McDuck  "
      ]
     },
     "execution_count": 171,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "id": "f82c8a0f",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df.dropna(how='all',axis=0).reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 186,
   "id": "fd974c2e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "      <td>75</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>75</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scööpy</td>\n",
       "      <td>Doo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>92</td>\n",
       "      <td>95</td>\n",
       "      <td>87</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     id   age    weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0   1.0  56.0     70kgs    72    69    71     -     -     -     Mickéy   \n",
       "1   2.0  34.0  70.40kgs     -     -     -    85    84    76     Donald   \n",
       "2   3.0  16.0       NaN     -     -     -    65    69    72       Mini   \n",
       "3   4.0   NaN     78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4   5.0  54.0  90.30kgs     -     -     -    69   NaN    75       Pink   \n",
       "5   6.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "6   7.0  19.0     56kgs     -     -     -    71    78    75      Dewey   \n",
       "7   8.0  32.0     78kgs    78    76    75     -     -     -     Scööpy   \n",
       "8   9.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "9  10.0  12.0     45kgs     -     -     -    92    95    87      Louie   \n",
       "\n",
       "  last_name  \n",
       "0     Mousé  \n",
       "1      Duck  \n",
       "2     Mouse  \n",
       "3    McDuck  \n",
       "4   Panther  \n",
       "5    McDuck  \n",
       "6    McDuck  \n",
       "7       Doo  \n",
       "8    McDuck  \n",
       "9    McDuck  "
      ]
     },
     "execution_count": 186,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 199,
   "id": "ab61434d",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.weight = df.weight.fillna(df.weight.dropna().apply(lambda x:x[:-3]).min() + 'kgs')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 200,
   "id": "9bf3d330",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    id   age    weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0  1.0  56.0     70kgs    72    69    71     -     -     -     Mickéy   \n",
       "1  2.0  34.0  70.40kgs     -     -     -    85    84    76     Donald   \n",
       "2  3.0  16.0     45kgs     -     -     -    65    69    72       Mini   \n",
       "3  4.0   NaN     78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4  5.0  54.0  90.30kgs     -     -     -    69   NaN    75       Pink   \n",
       "\n",
       "  last_name  \n",
       "0     Mousé  \n",
       "1      Duck  \n",
       "2     Mouse  \n",
       "3    McDuck  \n",
       "4   Panther  "
      ]
     },
     "execution_count": 200,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 202,
   "id": "cc4382bf",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df.drop_duplicates(['first_name','last_name','age','weight']).reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 204,
   "id": "89da39a0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "      <td>75</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>75</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scööpy</td>\n",
       "      <td>Doo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>92</td>\n",
       "      <td>95</td>\n",
       "      <td>87</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     id   age    weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0   1.0  56.0     70kgs    72    69    71     -     -     -     Mickéy   \n",
       "1   2.0  34.0  70.40kgs     -     -     -    85    84    76     Donald   \n",
       "2   3.0  16.0     45kgs     -     -     -    65    69    72       Mini   \n",
       "3   4.0   NaN     78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4   5.0  54.0  90.30kgs     -     -     -    69   NaN    75       Pink   \n",
       "5   6.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "6   7.0  19.0     56kgs     -     -     -    71    78    75      Dewey   \n",
       "7   8.0  32.0     78kgs    78    76    75     -     -     -     Scööpy   \n",
       "8  10.0  12.0     45kgs     -     -     -    92    95    87      Louie   \n",
       "\n",
       "  last_name  \n",
       "0     Mousé  \n",
       "1      Duck  \n",
       "2     Mouse  \n",
       "3    McDuck  \n",
       "4   Panther  \n",
       "5    McDuck  \n",
       "6    McDuck  \n",
       "7       Doo  \n",
       "8    McDuck  "
      ]
     },
     "execution_count": 204,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 207,
   "id": "fbb49527",
   "metadata": {},
   "outputs": [],
   "source": [
    "df['first_name'].replace({r\"[^\\x00-\\x7F]+\":\"\"},regex=True,inplace=True)\n",
    "df['last_name'].replace({r\"[^\\x00-\\x7F]+\":\"\"},regex=True,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 208,
   "id": "a82337c3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Micky</td>\n",
       "      <td>Mous</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "      <td>75</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>75</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scpy</td>\n",
       "      <td>Doo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>92</td>\n",
       "      <td>95</td>\n",
       "      <td>87</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     id   age    weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0   1.0  56.0     70kgs    72    69    71     -     -     -      Micky   \n",
       "1   2.0  34.0  70.40kgs     -     -     -    85    84    76     Donald   \n",
       "2   3.0  16.0     45kgs     -     -     -    65    69    72       Mini   \n",
       "3   4.0   NaN     78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4   5.0  54.0  90.30kgs     -     -     -    69   NaN    75       Pink   \n",
       "5   6.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "6   7.0  19.0     56kgs     -     -     -    71    78    75      Dewey   \n",
       "7   8.0  32.0     78kgs    78    76    75     -     -     -       Scpy   \n",
       "8  10.0  12.0     45kgs     -     -     -    92    95    87      Louie   \n",
       "\n",
       "  last_name  \n",
       "0      Mous  \n",
       "1      Duck  \n",
       "2     Mouse  \n",
       "3    McDuck  \n",
       "4   Panther  \n",
       "5    McDuck  \n",
       "6    McDuck  \n",
       "7       Doo  \n",
       "8    McDuck  "
      ]
     },
     "execution_count": 208,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 209,
   "id": "2e430236",
   "metadata": {},
   "outputs": [],
   "source": [
    "sorted_columns = ['id','age','weight','first_name','last_name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 212,
   "id": "b7f6c756",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.melt(df,\n",
    "         id_vars=sorted_columns,\n",
    "         var_name='sex_hour',\n",
    "         value_name='puls_rate')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 213,
   "id": "5dbc7203",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "      <th>sex_hour</th>\n",
       "      <th>puls_rate</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>Micky</td>\n",
       "      <td>Mous</td>\n",
       "      <td>m0006</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "      <td>m0006</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "      <td>m0006</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>m0006</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "      <td>m0006</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    id   age    weight first_name last_name sex_hour puls_rate\n",
       "0  1.0  56.0     70kgs      Micky      Mous    m0006        72\n",
       "1  2.0  34.0  70.40kgs     Donald      Duck    m0006         -\n",
       "2  3.0  16.0     45kgs       Mini     Mouse    m0006         -\n",
       "3  4.0   NaN     78kgs    Scrooge    McDuck    m0006        78\n",
       "4  5.0  54.0  90.30kgs       Pink   Panther    m0006         -"
      ]
     },
     "execution_count": 213,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 215,
   "id": "5ddc4bfb",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df[df.puls_rate != \"-\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 220,
   "id": "a4153e6e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(27, 7)"
      ]
     },
     "execution_count": 220,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 242,
   "id": "4475fc56",
   "metadata": {},
   "outputs": [],
   "source": [
    "def split_sex_hour(sex_hour):\n",
    "    sex = sex_hour[:1]\n",
    "    if sex == 'm':\n",
    "        gender = '男'\n",
    "    elif sex == 'f':\n",
    "        gender = '女'\n",
    "    hour = sex_hour[1:]\n",
    "    return gender+\",\"+hour"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 245,
   "id": "07bc9224",
   "metadata": {},
   "outputs": [],
   "source": [
    "df[['gender','hour']]=df.sex_hour.apply(split_sex_hour).str.split(\",\",expand=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 246,
   "id": "a87ac931",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "      <th>puls_rate</th>\n",
       "      <th>gender</th>\n",
       "      <th>hour</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>Micky</td>\n",
       "      <td>Mous</td>\n",
       "      <td>72</td>\n",
       "      <td>男</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>78</td>\n",
       "      <td>男</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>Scpy</td>\n",
       "      <td>Doo</td>\n",
       "      <td>78</td>\n",
       "      <td>男</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>Micky</td>\n",
       "      <td>Mous</td>\n",
       "      <td>69</td>\n",
       "      <td>男</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>79</td>\n",
       "      <td>男</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>Scpy</td>\n",
       "      <td>Doo</td>\n",
       "      <td>76</td>\n",
       "      <td>男</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>Micky</td>\n",
       "      <td>Mous</td>\n",
       "      <td>71</td>\n",
       "      <td>男</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>72</td>\n",
       "      <td>男</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>Scpy</td>\n",
       "      <td>Doo</td>\n",
       "      <td>75</td>\n",
       "      <td>男</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "      <td>85</td>\n",
       "      <td>女</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "      <td>65</td>\n",
       "      <td>女</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "      <td>69</td>\n",
       "      <td>女</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>68</td>\n",
       "      <td>女</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>71</td>\n",
       "      <td>女</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>92</td>\n",
       "      <td>女</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "      <td>84</td>\n",
       "      <td>女</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "      <td>69</td>\n",
       "      <td>女</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "      <td>NaN</td>\n",
       "      <td>女</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>75</td>\n",
       "      <td>女</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>78</td>\n",
       "      <td>女</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>95</td>\n",
       "      <td>女</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "      <td>76</td>\n",
       "      <td>女</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "      <td>72</td>\n",
       "      <td>女</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "      <td>75</td>\n",
       "      <td>女</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>72</td>\n",
       "      <td>女</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>75</td>\n",
       "      <td>女</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>87</td>\n",
       "      <td>女</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      id   age    weight first_name last_name puls_rate gender  hour\n",
       "0    1.0  56.0     70kgs      Micky      Mous        72      男  0006\n",
       "3    4.0   NaN     78kgs    Scrooge    McDuck        78      男  0006\n",
       "7    8.0  32.0     78kgs       Scpy       Doo        78      男  0006\n",
       "9    1.0  56.0     70kgs      Micky      Mous        69      男  0612\n",
       "12   4.0   NaN     78kgs    Scrooge    McDuck        79      男  0612\n",
       "16   8.0  32.0     78kgs       Scpy       Doo        76      男  0612\n",
       "18   1.0  56.0     70kgs      Micky      Mous        71      男  1218\n",
       "21   4.0   NaN     78kgs    Scrooge    McDuck        72      男  1218\n",
       "25   8.0  32.0     78kgs       Scpy       Doo        75      男  1218\n",
       "28   2.0  34.0  70.40kgs     Donald      Duck        85      女  0006\n",
       "29   3.0  16.0     45kgs       Mini     Mouse        65      女  0006\n",
       "31   5.0  54.0  90.30kgs       Pink   Panther        69      女  0006\n",
       "32   6.0  52.0  85.91kgs       Huey    McDuck        68      女  0006\n",
       "33   7.0  19.0     56kgs      Dewey    McDuck        71      女  0006\n",
       "35  10.0  12.0     45kgs      Louie    McDuck        92      女  0006\n",
       "37   2.0  34.0  70.40kgs     Donald      Duck        84      女  0612\n",
       "38   3.0  16.0     45kgs       Mini     Mouse        69      女  0612\n",
       "40   5.0  54.0  90.30kgs       Pink   Panther       NaN      女  0612\n",
       "41   6.0  52.0  85.91kgs       Huey    McDuck        75      女  0612\n",
       "42   7.0  19.0     56kgs      Dewey    McDuck        78      女  0612\n",
       "44  10.0  12.0     45kgs      Louie    McDuck        95      女  0612\n",
       "46   2.0  34.0  70.40kgs     Donald      Duck        76      女  1218\n",
       "47   3.0  16.0     45kgs       Mini     Mouse        72      女  1218\n",
       "49   5.0  54.0  90.30kgs       Pink   Panther        75      女  1218\n",
       "50   6.0  52.0  85.91kgs       Huey    McDuck        72      女  1218\n",
       "51   7.0  19.0     56kgs      Dewey    McDuck        75      女  1218\n",
       "53  10.0  12.0     45kgs      Louie    McDuck        87      女  1218"
      ]
     },
     "execution_count": 246,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.drop('sex_hour',axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a2cec0e5",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "19d4147e",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
